'use strict';

module.exports = appInfo => {
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1536211050682_6881';
  config.mysql = {
    // 单数据库信息配置
    client: {
      // host
      host: 'localhost',
      // 端口号
      port: '3306',
      // 用户名
      user: 'root',
      // 密码
      password: '19930309',
      // 数据库名
      database: 'house_server',
    },
    // 是否加载到 app 上，默认开启
    app: true,
    // 是否加载到 agent 上，默认关闭
    agent: false,
  };
  config.security = {
    domainWhiteList: [ 'http://192.168.0.146:7001' ],
  };
  config.cors = {
    "origin":'*',
    "allowMethods" : 'GET,HEAD,PUT,POST,DELETE,PATCH' 
  }
  // add your config here
  config.middleware = ['errorHandler',"responseFormatter"];
  // config.errorHandler = {
  //   match:"/",
  // }
  return config;
};
